package door

import "gitee.com/wcs2/common/enums"

type doorStatusStruct struct {
	CLOSED  enums.PositionEnum
	OPENED  enums.PositionEnum
	ON_WORK enums.PositionEnum
	UNKNOWN enums.PositionEnum
}

//自动门状态枚举
var DoorStatusEnum = &doorStatusStruct{
	CLOSED: enums.PositionStruct{
		Code:    "CLOSED",
		Des:     "关闭状态",
		PlcCode: 20,
	}, OPENED: enums.PositionStruct{
		Code:    "OPENED",
		Des:     "开启状态",
		PlcCode: 40,
	}, ON_WORK: enums.PositionStruct{
		Code:    "ON_WORK",
		Des:     "工作中（正在开/正在关）",
		PlcCode: 50,
	}, UNKNOWN: enums.PositionStruct{
		Code:    "UNKNOWN",
		Des:     "未知状态",
		PlcCode: 100,
	},
}

var DoorStatusEnumMap = map[int]enums.PositionStruct{
	20:  DoorStatusEnum.CLOSED,
	40:  DoorStatusEnum.OPENED,
	50:  DoorStatusEnum.ON_WORK,
	100: DoorStatusEnum.UNKNOWN,
}
